package com.bytz.modules.system.controller;

import com.bytz.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import java.util.Set;

@RequestMapping("/sys/mvc")
@RestController
public class MvcInfoController {
    @Autowired
    private RequestMappingHandlerMapping requestMappingHandlerMapping;

    @RequestMapping(value = "/endPoints", method = RequestMethod.GET)
    public Result<Set<RequestMappingInfo>> getEndPointsInView() {
        return Result.ok(requestMappingHandlerMapping.getHandlerMethods().keySet());
    }
}
